<!DOCTYPE html>
<html lang="zh">
	<head>
		<meta charset="utf-8" />
		<title>window对象</title>
	</head>
	<body>
		<div id="div1">xxxxxx</div>
		<input type="button" value="获取window窗口宽度和高度" onclick="click1()" />
		<input type="button" value="打开窗口" onclick="click2()" />
		<input type="button" value="关闭窗口" onclick="click3()" />
		<script type="text/javascript">
			var age=20;
			document.write(window.age);
			function show(){
				document.write(window.age);
			}
			
			window.show();
			
			var div1=window.document.getElementById("div1");
			console.log(div1.innerHTML);
			
//			
//			window.alert();
//			window.confirm()

		/*获取浏览器窗口的尺寸*/
	


		
//			
//		var x;
//		var y;
//		var z=10;
//		
//		var result=x||y||z;
//		document.write(result);

		function click1(){
				var w=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;
				var h=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;
				alert("宽度:"+w+" 高度:"+h);
				
		}
		var mywindow;
		function click2(){
			mywindow=window.open("http://www.baidu.com");
		}
		
		function click3(){
			//window.close();//关闭当前窗口
			mywindow.close();
		}
		
			
		</script>
		
	</body>
</html>
